package com.etc.order.provider.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.etc.order.common.domain.OrderDetail;
import com.etc.order.common.service.OrderDetailService;
import com.etc.order.provider.mapper.OrderDetailMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class OrderDetailServiceImpl implements OrderDetailService {
    @Autowired
    private OrderDetailMapper orderDetailMapper;

    @Override
    public List<OrderDetail> findOrderDetailByOrderId(String orderId, int pageIndex, int pageSize) {
        return orderDetailMapper.findByOrderId(orderId, pageIndex, pageSize);
    }

    @Override
    public OrderDetail getOne(String detailId) {
        return orderDetailMapper.getOne(detailId);
    }

    @Override
    public int getTotalCount(String orderId) {
        return orderDetailMapper.getTotalSize(orderId);
    }

    @Override
    public List<OrderDetail> findAll(int pageIndex, int pageSize) {
        return orderDetailMapper.findAll(pageIndex, pageSize);
    }
}
